<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script type="text/javascript" src="./js/jquery-3.1.1.min.js"></script>
</head>
<script>
    $(function(){
        var myname = $('div').text();
        $('button').click(function(){
            alert(myname);
        })
    })
</script>
<body>
    <div style="display: none">
    <?php 
        session_start();
        echo session_id(); 
    ?>
    </div>
    <button type="button">我是按钮哦</button>
</body>
</html>